//
//  YXLocalized.h
//  YXInternational
//
//  Created by GMS on 2020/8/28.
//  Copyright © 2020 Arhtur. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

static NSString * const AppLanguage = @"appLanguage";

#define YXLocalized(str)  [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:AppLanguage]] ofType:@"lproj"]] localizedStringForKey:(str) value:@"" table:nil]

#define YXLocalizedFromTable(Str,Table) [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[[NSUserDefaults standardUserDefaults] objectForKey:AppLanguage] ofType:@"lproj"]] localizedStringForKey:(Str) value:@"" table:(Table)]

@interface YXLocalized : NSObject

+ (YXLocalized *)sharedInstance;

//初始化多语言功能
- (void)initLanguage;

//当前语言
- (NSString *)currentLanguage;

//设置要转换的语言
- (void)setLanguage:(NSString *)language;

//设置为系统语言
- (void)systemLanguage;

@end

NS_ASSUME_NONNULL_END
